﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section scripts
{
    <script src="~/Scripts/App/Publisher/publisherLayout.js"></script>
    <script type="text/javascript" src="~/Scripts/App/Publisher/index.js"></script>
     <script>
        $(document).confirmWithReveal({
            ok: 'Tiếp tục xóa',
            cancel: 'Quay lại',
            title: 'Xác Nhận Xóa!',
            body: 'Bạn có chắc chắn muốn xóa'
        })
    </script>
}
<div id="cover_publisher">
    <header class="user-channel" data-bind="style: { 'background': Cover }">
        <div class="single-video-mask"></div>
        <div class="row">
            <div class="large-6 columns">
                <div class="header-for-show">
                    <div class="large-12 small-12 columns">
                        <h4><i class="fi fi-star"></i><span data-bind="text: ChannelName">Trương Quang Nhật</span></h4>
                        <ul>
                            <li data-bind="visible: Facebook"><span class="sub-info"><i class="fi fi-social-facebook"></i><span data-bind="    text: Facebook"></span></span></li>
                            <li data-bind="visible: Phone"><span class="sub-info"><i class="fi fi-mobile"></i><span data-bind="    text: Phone"></span></span></li>
                            <li data-bind="visible: Address"><span class="sub-info"><i class="fi fi-address-book"></i><span data-bind="    text: Address"></span></span></li>
                            <li>
                                <form>
                                    <button class="button tiny change-cover" data-bind="click: $root.doChangeCover">Thay đổi cover</button>
                                    <input id="file_changeCover" type="file" name="cover" data-bind="visible: false, CoverUpload: { property: 'ChannelCover', url: '/api/Publisher/PostCover' }" accept="image/*" />
                                </form>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="large-6 columns">
                <div class="avatar right relative" style="min-height: 220px">
                    <img data-bind="src: LogoLink" class="right">
                    <form>
                        <button id="btn_changeAvatar" class="button tiny" data-bind="click: $root.doChangeAvatar">Thay hình đại diện</button>
                        <input id="file_changeAvatar" type="file" name="logo" data-bind="visible: false, LogoUpload: { property: 'LogoLink', url: '/api/Publisher/PostLogo' }" accept="image/*" />
                    </form>
                </div>
            </div>
            <div class="large-12 columns">
                <ul class="pagination user-top-bar">
                    <li><a href="../publisher/index">Danh mục chính</a></li>
                    <li><a href="../publisher/createadv">Tạo quảng cáo</a></li>
                    <li><a href="../publisher/about">Giới thiệu về công ty</a></li>
                    <li><a href="../publisher/editprofile">Chỉnh sửa thông tin</a></li>
                    <li><a href="#">Bản quyền</a></li>
                    <li><a href="../Publisher/gallery">Thư viện ảnh</a></li>
                </ul>
            </div>
        </div>
    </header>
</div>
<div class="large-12 title-header text-centered">
    <h3 class="upper white">Danh Mục Chính</h3>
</div>
<div class="row body forum-detail">
    <div class="large-12 small-12 columns">

        <div class="row post-details posts">
            <div class="large-9 small-12 columns" id="content_publisher">
                <div id="lst">
                    <h3><i class="fi fi-thumbnails blue"></i>Danh Sách Quảng Cáo Đã Upload</h3>
                    <select class="right radius" data-bind="value: level, event: { change: doChange }">
                        <option value="0">Mới Nhất</option>
                        <option value="1">Cũ Nhất</option>
                        <option value="2">Xem Nhiều Nhất</option>
                        <option value="3">Yêu Thích Nhất</option>
                    </select>
                    <span class="clear"></span>
                    <div class="row border-wrap category" data-bind="foreach: Advertises">
                        <div class="medium-12 large-12 columns">
                            <div class="medium-3 small-3 columns">
                                <div class="view view-normal">
                                    <img height="100" width="150" data-bind="src: PreviewImg">
                                    <div class="mask">
                                       @* <h2>Thao Tác</h2>
                                        <a class="info wid50" data-bind="click: $root.setEditView"><i class="fi fi-pencil"></i></a>
                                        <a class="info wid50" data-confirm="" data-bind="click: function () { $root.doDelete(AdvId) }"><i class="fi fi-trash"></i></a>*@

                                        <form data-bind="submit: function () { $root.doDelete(AdvId) }">
                                            <button type="submit" class="info wid50" data-confirm=""><i class="fi fi-trash"></i></button>
                                        </form>
                                    </div>
                                </div>
                            </div>
                            <div class="medium-9 small-9 columns">
                                <a data-bind="href: '../../home/advertise/' + AdvId">
                                    <h6 data-bind="text: Title"></h6>
                                </a>
                                <span class="button small no-padding" data-bind="text: Likes + ' likes'"></span>
                                <span class="button small no-padding" data-bind="text: Views + ' views'"></span>
                                <p class="size12" data-bind="text: ShortDes">Các cầu thủ Arsenal gần như không còn cơ hội vô địch Ngoại hạng Anh, nhưng lúc này ...</p>
                            </div>

                        </div>
                    </div>
                    <div class="row">
                        <ul class="pagination right">
                            <li><a href="#">Tải thêm</a></li>
                        </ul>
                    </div>
                </div>
                <div id="edit" style="display: none">
                    <h3>Quảng Cáo</h3>
                    <h6 class="subheader">Chỉnh sửa thông tin</h6>
                    <span class="clear"></span>
                    <div class="row border-wrap category">
                        <form data-abide data-bind="submit: $root.doEdit">
                            <div class="row user-info">
                                <div class="large-3 medium-3 columns">
                                    <span>Tên quảng cáo:</span>
                                </div>
                                <div class="large-8 medium-8 columns">
                                    <input type="text" data-bind="value: Title" required pattern="[a-zA-Z]+">
                                    <small class="error">Tên quảng cáo chỉ bao gồm chữ</small>
                                </div>
                            </div>
                            <div class="row user-info">
                                <div class="large-3 medium-3 columns">
                                    <span>Tên Sản Phẩm:</span>
                                </div>
                                <div class="large-8 medium-8 columns">
                                    <input type="text" required data-bind="value: ProductName" pattern="[a-zA-Z]+">
                                    <small class="error">Tên sản phẩm chỉ bao gồm chữ</small>
                                </div>
                            </div>
                            <div class="row user-info">
                                <div class="large-3 medium-3 columns">
                                    <span>Mô Tả Ngắn</span>
                                </div>
                                <div class="large-8 medium-8 columns">
                                    <textarea rows="5" required data-bind="value: ShortDes"></textarea>
                                    <small class="error">Mô tả ngắn là bắt buột có</small>
                                </div>
                            </div>
                            <div class="row user-info">
                                <div class="large-3 medium-3 columns">
                                    <span>Nội Dung</span>
                                </div>
                                <div class="large-8 medium-8 columns">
                                    <textarea id="ckeditor-des" rows="6" required class="ckeditor flat" name="description"></textarea>
                                    <small class="error">Mô tả ngắn là bắt buột có</small>
                                </div>
                            </div>
                            <div class="row user-info">
                                <div class="large-3 medium-3 columns">
                                </div>
                                <div class="large-8 medium-8 columns">
                                    <input type="submit" value="Lưu" class="right button small">
                                    <span class="right">&nbsp;&nbsp;</span>
                                    <input type="button" data-bind="click: $root.doBack" value="Quay Lại" class="right button small">
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div id="right_publisher" class="large-3 small-12 columns">
                <dl class="tabs" data-tab>
                    <dd class="active"><a href="#panel2-2">Bình luận</a></dd>
                    <dd><a href="#panel2-1">Theo dõi</a></dd>
                </dl>
                <div class="tabs-content">
                    <div class="content" id="panel2-1" data-bind="foreach: Subcribers">
                        <div class="rank-list">
                            <div class="large-4 columns">
                                <img data-bind="src: Avatar" />
                            </div>
                            <div class="large-8 columns">
                                <h6><strong data-bind="text: Name"></strong></h6>
                                <h6 data-bind="text: DateSubcribe"></h6>
                            </div>
                        </div>
                    </div>
                    <div class="content active" id="panel2-2" data-bind="foreach: Comments">
                        <div class="comment-list">
                            <a data-bind="text: Name, href: '#' + Id"></a><span class="italiced">nói</span>
                            (<small data-bind="timeAgo: DateComment"></small>)
                            <p data-bind="html: Content"></p>
                            <a class="right" data-bind="href: '#' + AdvId">
                                <span class="darked pull-right" data-bind="text: Title"></span>
                            </a>
                        </div>
                        <p class="clear"></p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
